﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using WFBot.Framework.Repositories;

namespace WFBot.Framework.Web.Controllers
{
    public class AdministrationController : Controller
    {
        private readonly IVisitorRepository _visitorRepository;

        public AdministrationController(IVisitorRepository visitorRepository)
        {
            _visitorRepository = visitorRepository;
        }

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Visitors(string criteria)
        {
            if (!string.IsNullOrWhiteSpace(criteria))
            {
                return View(_visitorRepository.FindByIdentifier(criteria));
            }
            else
            {
                return View(_visitorRepository.All());
            }
        }

        public ActionResult VisitorReplies(long id)
        {
            var visitor = _visitorRepository.GetById(id);
            return View(visitor);
        }
    }
}
